package com.hp.controller;

import com.hp.pojo.Form;
import com.hp.service.FormService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class FormController {
    @Autowired
    FormService formService;

    @PostMapping("/getAllForms")
    Map<String,Object> getAllForms(){

        return formService.getAllForms();
    }

    @PostMapping("/AddForm")
    public Map<String, Object> AddForm(Form form){
        return formService.AddForm(form);
    }

    @PostMapping("/CompleteForm")
    public Map<String, Object> CompleteForm(int formId){
        return formService.CompleteForm(formId);
    }

//    @PostMapping("/GetFormsByagentId")
//    Map<String,Object> GetFormsByagentId(int agentId) {
//        return formService.getFromsByagentId(agentId);
//    }

    @PostMapping("/addForm")
    Map<String,Object> addForm(int houseId, int formType, int formBuyerid, int formSellerid, int agentId){

        return formService.addForm(houseId, formType, formBuyerid, formSellerid, agentId);
    }

}
